package com.itheima.d6_singleInstance;

public class Wife {
    private String name;

    //2 定义一个当前类型的静态变量，并私有化
    private static Wife wife = new Wife();
    //1.将构造方法私有化
    private Wife() {
        name = "hhhh";
    }
    //3.定义一个静态方法用来返回当前实例
    public static Wife getWife() {
        return wife;
    }

}
